package com.prs.crm.dao.sale.impl;

import java.util.List;

import org.hibernate.Criteria;
import org.hibernate.criterion.Restrictions;

import com.prs.crm.dao.impl.BaseDaoImpl;
import com.prs.crm.dao.sale.SalesShippingDetailDao;
import com.prs.crm.domain.sale.SalesContract;
import com.prs.crm.domain.sale.SalesShippingDetail;

public class SalesShippingDetailDaoImpl extends BaseDaoImpl<SalesShippingDetail> implements SalesShippingDetailDao {

	@Override
	public List<SalesShippingDetail> salesShippingDetails(
			SalesContract salesContract) {
		Criteria criteria=this.getSession().createCriteria(SalesShippingDetail.class);
		criteria.createAlias("salesShipping", "b");
		criteria.add(Restrictions.eq("b.salesContract", salesContract));
		criteria.add(Restrictions.eq("retruenState", 0));
		return criteria.list();
	}

}
